<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<script type="text/javascript">
var errorMessage="";
<s:if test="hasFieldErrors()">
	<s:iterator value="fieldErrors">
		<s:iterator value="value" status="statu">
			<s:set name="msg" value="((#msg==null || #msg=='')?'':#msg+'\\\n')" />
			<s:set name="msg" value="#msg+value.get(#statu.getIndex()).toString()" />
		</s:iterator>
	</s:iterator>
</s:if>
<s:if test="hasActionErrors()">
	<s:iterator value="actionErrors">	
		
			if(errorMessage.length>0){
				errorMessage+="\n";
			}
			errorMessage+="<s:property escape="false"/>";   
		 
	</s:iterator>
</s:if>
<s:if test="hasActionMessages()">
	<s:iterator value="actionMessages">	
		
            if(errorMessage.length>0){
				errorMessage+="\n";
			}
			errorMessage+="<s:property escape="false"/>";     
			
	</s:iterator>
</s:if>
<s:if test="#msg.length()>0">	
	
	if(errorMessage.length>0){
				errorMessage+="\n";
			}
			errorMessage+="<s:property escape="false" value="#msg"/>";
			
</s:if>
<s:set name="errorMsg" value="#session.errorMessage.toString()" />
<s:if test="#errorMsg.length()>0">	
	if(errorMessage.length>0){
				errorMessage+="\n";
			}
			errorMessage+="<s:property escape="false" value="#errorMsg"/>";
	
</s:if>

<%
session.removeAttribute("errorMessage");
%>
</script>   

<script type="text/javascript">   
if(errorMessage.length>0){	
	alert(errorMessage);
}
</script>